package com.example.rbacmanage.config;

import io.minio.MinioClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
public class MinioConfig {
    //访问地址
    @Value("${minio.endpoint}")
    private String endpoint;
    //访问key
    @Value("${minio.accessKey}")
    private String accessKey;
    //访问秘钥
    @Value("${minio.secretKey}")
    private String secretKey;
    //桶
    @Value("${minio.bucketName}")
    private String bucketName;

    @Bean
    public MinioClient minioClient(){
        return MinioClient.builder().endpoint(endpoint).credentials(accessKey,secretKey).build();
    }
}
